﻿//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Mapping Application Block
//===============================================================================

using System;

namespace EntLibContrib.Mapping
{
	/// <summary>
	/// Attribute to decorate domain object classes and structs for automatic
	/// selection and mapping of domain objects from an assembly
	/// </summary>
	[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple=false, Inherited=true)]
	public sealed class MapperAttribute : Attribute
	{
		#region Fields
		private string name;
		private string tableName;
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the name or the mapper.
		/// </summary>
		/// <value>The name of the mapper.</value>
		public string Name
		{
			get { return name; }
			set { name = value; }
		}

		/// <summary>
		/// Gets or sets the name of the mapped table.
		/// This will match the name of a table in the data transfer object.
		/// </summary>
		/// <value>The name of the mapped table.</value>
		public string TableName
		{
			get { return tableName; }
			set { tableName = value; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="MapperAttribute"/> class.
		/// </summary>
		public MapperAttribute()
		{ }
		#endregion
	}
}
